<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="./template/layout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="conteudo">
	<div style="margin: 10px 10px 0 10px;">

		<h:form style="margin-left:10px; margin-right:20px; text-align:center;">
	 	   <p:dataTable var="u" id="tabela" value="#{usuarioBEAN.usuarios}" binding="#{usuarioBEAN.datatable}" >
	 	   	<p:column>
	   	 		<f:facet name="header">
	 	   			<h:outputText value="ID" />
	    		</f:facet>
	    		<h:outputText value="#{u.id}" />
	    	</p:column>
	    	<p:column>
	    		<f:facet name="header">
	    			<h:outputText value="Nome" />
	    		</f:facet>
	    		<h:outputText value="#{u.nome}" />
	    	</p:column>
	        <p:column>
	    		<f:facet name="header">
	    			<h:outputText value="Login" />
	    		</f:facet>
	    		<h:outputText value="#{u.login}" />
	    	</p:column>
	    	<p:column>
	    		<f:facet name="header">
	    			<h:outputText value="Curso" />
	    		</f:facet>
	    		<h:outputText value="#{u.curso}" />
	    	</p:column>
	    	<p:column>
	    		<f:facet name="header">
	    			<h:outputText value="Ação" />
	    		</f:facet>
	    		<p:commandButton icon="ui-icon-wrench" action="#{usuarioBEAN.editarUsuario()}" ajax="false"/>
	    		<p:commandButton icon="ui-icon-trash" action="#{usuarioBEAN.deletarUsuario()}" ajax="false"/>
	    	</p:column>
	    </p:dataTable>
	    <h:panelGrid>
				<p:panel header="Emitir Relatório">
				<h:commandLink>  
	        	    <p:graphicImage value="/images/excel.png" />  
	            	<p:dataExporter type="xls" target="tabela" fileName="emprestimosResevados" />  
	  		    </h:commandLink>  
	  	        <h:commandLink>  
	  	    	    <p:graphicImage value="/images/pdf.png" />  
	    	        <p:dataExporter type="pdf" target="tabela" fileName="emprestimosResevados" />  
	        	</h:commandLink>
	        	</p:panel>
	        	</h:panelGrid>
	</h:form>
	</div>
	</ui:define>
</ui:composition>
